import BaseService from "./BaseService";

/**
 * 产品service
 */
export default class MallService extends BaseService {

  constructor() {
    super();
  }

  /**
   * 返回list
   */
  list() {
    const url = `${this.host}/shopping-sku`;
    return this.get(url).then(data => data != '' ? data : Promise.reject('NO_SKU_LIST'));
  }

  detail(skuId) {
    const url = `${this.host}/shopping-sku/${skuId}`;
    return this.get(url).then(data => data != '' ? data : Promise.reject('NO_SKU_DETAIL'));
  }
}
